package org.snail.transport.protocol;

import java.io.Serializable;

/**
 * 消息请求体
 *
 * 这三个元素 group:serviceProviderName:version 对应一个类
 *
 * Created by fish on 17/8/18.
 */
public class Request implements Serializable {

    /**
     * 应用名称
     */
    private String appName;

    /**
     * 服务组别
     */
    private String group;

    /**
     * 服务名称
     */
    private String serviceProviderName;

    /**
     * 服务版本号
     */
    private String version;

    /**
     * 目标方法名称
     */
    private String methodName;

    /**
     * 返回类型
     */
    private Class<?> returnType;

    /**
     * 目标方法参数
     */
    private Object[] args;

    /**
     * 链路追踪-全局唯一的ID
     */
    private String traceId;

    /**
     * 经过的节点数
     */
    private int node;

    /**
     * 权限控制标识符
     */
    private String tokenId;

    /**
     * 时间戳, 用于后续监控对该请求的处理时间
     */
    private transient long timestamp;


    public String getAppName() {
        return appName;
    }

    public void setAppName(String appName) {
        this.appName = appName;
    }

    public String getServiceProviderName() {
        return serviceProviderName;
    }

    public void setServiceProviderName(String serviceProviderName) {
        this.serviceProviderName = serviceProviderName;
    }

    public String getMethodName() {
        return methodName;
    }

    public void setMethodName(String methodName) {
        this.methodName = methodName;
    }

    public String getGroup() {
        return group;
    }

    public void setGroup(String group) {
        this.group = group;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public Object[] getArgs() {
        return args;
    }

    public void setArgs(Object[] args) {
        this.args = args;
    }

    public String getTraceId() {
        return traceId;
    }

    public void setTraceId(String traceId) {
        this.traceId = traceId;
    }

    public String getTokenId() {
        return tokenId;
    }

    public void setTokenId(String tokenId) {
        this.tokenId = tokenId;
    }

    public long getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(long timestamp) {
        this.timestamp = timestamp;
    }

    public int getNode() {
        return node;
    }

    public void setNode(int node) {
        this.node = node;
    }

    public Class<?> getReturnType() {
        return returnType;
    }

    public void setReturnType(Class<?> returnType) {
        this.returnType = returnType;
    }
}
